Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class FrmCrSoChiTiet_HangHoaSanPham
    Private tenhh, dvt As String
    Private thangnam, tungay, denngay As Date
    Private thanhTienDauKy As Double
    Private soLuongDauKy As Double
    Private customerReport As ReportDocument

    Private Sub FrmCrSoChiTiet_HangHoaSanPham_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        frmLoading.Show()
        Dim sqlQuery As String = "SELECT * from tbl_dot_sochitiet_sanphamhanghoa ORDER BY ngayCT"
        Dim reportPath = Application.StartupPath & "\" & "crSoChiTiet_HangHoaSanPham.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        customerReport.SetParameterValue("TTenhh", tenhh)
        customerReport.SetParameterValue("TDvt", dvt)
        customerReport.SetParameterValue("TThangnam", thangnam)
        customerReport.SetParameterValue("TTungay", tungay)
        customerReport.SetParameterValue("TDenngay", denngay)
        customerReport.SetParameterValue("thanhTienDauKy", thanhTienDauKy)
        customerReport.SetParameterValue("soLuongDauKy", soLuongDauKy)
        customerReport.SetParameterValue("ketoantruong", globalVariale.KETOANTRUONG)
        customerReport.SetParameterValue("giamdoc", globalVariale.TONGGIAMDOC)
        Me.CrNXTTongHopview.ReportSource = customerReport
        frmLoading.Close()
        frmLoading.Dispose()
    End Sub

    Public Sub setThanhTienDauKy(ByVal n As Double)
        thanhTienDauKy = n
    End Sub

    Public Sub setSoLuongDauKy(ByVal n As Double)
        soLuongDauKy = n
    End Sub

    Public Sub setTenhh(ByVal s As String)
        tenhh = s
    End Sub

    Public Sub setDvt(ByVal s As String)
        dvt = s
    End Sub

    Public Sub setThangnam(ByVal s As Date)
        thangnam = s
    End Sub
    Public Sub setTungay(ByVal s As Date)
        tungay = s
    End Sub
    Public Sub setDenngay(ByVal s As Date)
        denngay = s
    End Sub
End Class
